home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / KADFILE.ZIP / ENCRYPT.H < prev    next >
Text File  |  1995-03-06  |  647b  |  24 lines

  1. char encryptionkey[44] = {"sdfoi(*A()8 eritkkljhdsf7 ;LJdkfglk=+_)48*&"};
  2. void encryptdir(char *directory,int numdirs,char *password)
  3. {
  4.     int x,y,z;  
  5.     if (strcmp(password,"") != 0) {                    /* encrypt directory */
  6.         x = 0;
  7.         y = 0;
  8.         z = 0;
  9.         while (x < (sizeof(dir_struc)*numdirs)) {
  10.             directory[x] = (directory[x] ^ (password[y] ^ encryptionkey[z]));
  11.             x++;
  12.             y++;
  13.             z++;
  14.             
  15.             if (z > strlen(encryptionkey))
  16.                 z = 0;
  17.  
  18.             if (y > strlen(password))
  19.                 y = 0;
  20.         
  21.         }
  22.     }
  23. }
  24.